import request from '@/utils/request'

// 查询种植户档案列表
export function listFarmerinfo(query) {
  return request({
    url: '/farmer/farmerinfo/list',
    method: 'get',
    params: query
  })
}

// 查询种植户档案详细
export function getFarmerinfo(guid) {
  return request({
    url: '/farmer/farmerinfo/' + guid,
    method: 'get'
  })
}

// 新增种植户档案
export function addFarmerinfo(data) {
  return request({
    url: '/farmer/farmerinfo',
    method: 'post',
    data: data
  })
}

// 修改种植户档案
export function updateFarmerinfo(data) {
  return request({
    url: '/farmer/farmerinfo',
    method: 'put',
    data: data
  })
}

// 删除种植户档案
export function delFarmerinfo(guid) {
  return request({
    url: '/farmer/farmerinfo/' + guid,
    method: 'delete'
  })
}

// 导出种植户档案
export function exportFarmerinfo(query) {
  return request({
    url: '/farmer/farmerinfo/export',
    method: 'get',
    params: query
  })
}

// 通过权限获取种植户
export function getHasPermissionFarmers() {
  return request({
    url: '/farmer/farmerinfo/getHasPermissionFarmers',
    method: 'get',
  })
}

// 查询所有用户
export function getAllFarmers(query) {
  return request({
    url: '/farmer/farmerinfo/getAll',
    method: 'get',
    params: query
  })
}
